package cn.gemframe.exception;

import cn.gemframe.exception.status.GemErrorStatus;
import lombok.Builder;
import lombok.Data;
import org.springframework.http.HttpStatus;

@Data
@Builder
public class GemException extends RuntimeException {
	private static final long serialVersionUID = -2319097667755215294L;
	
	private Long code;
	private String msg;

	public GemException() {
		super();
	}
	
	public GemException(String msg) {
		this.msg = msg;
	}
	
	public GemException(GemErrorStatus errorStatus) {
		this.code = errorStatus.getCode();
		this.msg = errorStatus.getMsg();
	}
	
	public GemException(Long code, String message) {
		this.code =code;
		this.msg = message;
	}

}
